// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    money: 0,
    suffix: '块钱',
    message: '',
    numAnimate: {}
  },
  onLoad() {
    setInterval(() => {
      this.data.money ++
      this.setData({
        message: `${this.data.money} ${this.data.suffix}`,
        numAnimate: this.generateAnimation()
      })
    }, 1000)
  },
  generateAnimation() {
    const animation = wx.createAnimation({
      duration: 500,
      timingFunction: 'ease-in-out',
    })
    animation.opacity(1).step().opacity(0).step()
    return animation.export()
  }
})
